package com.lanou3g.zjl.chating.application;

import android.app.Application;
import android.content.Context;

import com.baidu.mapapi.SDKInitializer;
import com.easemob.chat.EMChat;
import com.easemob.chat.EMChatManager;
import com.easemob.chat.EMChatOptions;
import com.parse.Parse;

/**
 * Created by dllo on 15/11/19.
 */
public class BaseApplication extends Application{
    private static Context mContext;

    @Override
    public void onCreate() {
        super.onCreate();
        //百度地图初始化
        SDKInitializer.initialize(this);
        //连接Parse进行数据交互
        Parse.enableLocalDatastore(this);
        Parse.initialize(this, "XG6EqmGhN04PMxtaQcJZcGX1SfgZe4RKXD1dTSQq", "rMfIyMH7mZf9Hjn4xxPG8yd3ud893LOCcNnRkyUl");

        mContext = getApplicationContext();
        EMChat.getInstance().init(mContext);
        // 获取到EMChatOptions对象
        EMChatOptions options = EMChatManager.getInstance().getChatOptions();
        // 默认添加好友时，是不需要验证的，改成需要验证
        options.setAcceptInvitationAlways(false);
        // 默认环信是不维护好友关系列表的，如果app依赖环信的好友关系，把这个属性设置为true
        options.setUseRoster(true);

//        hxSDKHelper.onInit(mContext);
    }

    public static Context getContext() {
        return mContext;
    }
}
